{template 'common/header'}
{php $packages = get_AllPackage()}
<style type="text/css">
    .panel-body > ul{list-style:none;margin: 0px;padding: 0px}
    .panel-body > ul li{display: inline-block}
</style>
<div class="main">
<ul class="nav nav-tabs">
    <li><a href="{php echo url('member/member');}">充值续费</a></li>
    <li><a href="{php echo url('member/buypackage');}">套餐购买</a></li>
    <li><a href="{php echo url('member/buysms');}">短信购买</a></li>
	{if $_W['isfounder']}
    <li><a href="{php echo url('member/record');}">会员消费</a></li>
	<li class="active"><a href="{php echo url('member/configs');}">服务配置</a></li>
    {/if}
</ul>
    <div style="width: 100%" >
        <aside>
            <section>
                <form action="" class="form-horizontal form" method="post" enctype="multipart/form-data">
                    <div class="panel panel-default">
                        <div class="panel-heading">支付配置</div>
                        <div class="panel-body">
                            <div class="form-group">
                                <div class="col-sm-2"></div>
                                <div class="col-sm-8">
                                    <div class="input-group" >
                                        <span class="input-group-addon" style="width: 25%">百付宝商户号</span>
                                        <input class="form-control" name="save[mchid]" type="text" placeholder="商户号" value="{$save[mchid]}">
                                        <span class="input-group-addon"></span>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-sm-2"></div>
                                <div class="col-sm-8">
                                    <div class="input-group" >
                                        <span class="input-group-addon" style="width: 25%">商户支付密钥</span>
                                        <input class="form-control" name="save[signkey]" type="text" placeholder="商户支付密钥" value="{$save[signkey]}" />
                                        <span class="input-group-addon"></span>
                                    </div>
                                </div>
                                <div class="col-sm-2"></div>
                            </div>
                            <div class="form-group">
                                <div class="col-sm-2"></div>
                                <div class="col-sm-8">
                                    <div class="input-group" >
                                        <span class="input-group-addon" style="width: 25%">在线充值客服QQ</span>
                                        <input class="form-control" name="save[service_qqs]" type="text" placeholder="在线充值客服QQ,多个用|分割 比如：张三【客服】-123135|李四【技术】-152154" value="{$save[service_qqs]}" />
                                        <span class="input-group-addon"></span>
                                    </div>
                                </div>
                                <div class="col-sm-2"></div>
                            </div>
                            <div class="form-group">
                                <div class="col-sm-2"></div>
                                <div class="col-sm-8">
                                    <div class="input-group" >
                                        <span class="input-group-addon" style="width: 25%">支付宝帐号</span>
                                        <input class="form-control" name="save[alipay_account]" type="text" placeholder="支付宝帐号" value="{$save[alipay_account]}">
                                        <span class="input-group-addon"></span>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-sm-2"></div>
                                <div class="col-sm-8">
                                    <div class="input-group" >
                                        <span class="input-group-addon" style="width: 25%">支付宝合作者身份</span>
                                        <input class="form-control" name="save[partner]" type="text" placeholder="支付宝合作者身份" value="{$save[partner]}">
                                        <span class="input-group-addon"></span>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-sm-2"></div>
                                <div class="col-sm-8">
                                    <div class="input-group" >
                                        <span class="input-group-addon" style="width: 25%">支付宝校验密钥</span>
                                        <input class="form-control" name="save[key]" type="text" placeholder="支付宝校验密钥" value="{$save[key]}" />
                                        <span class="input-group-addon"></span>
                                    </div>
                                </div>
                                <div class="col-sm-2"></div>
                            </div>
                        </div>
                    </div>
                    <div class="panel panel-default">
                        <div class="panel-heading">短信配置</div>
                        <div class="panel-body">
                            <div class="form-group">
                                <div class="col-sm-2"></div>
                                <div class="col-sm-8">
                                    <div class="input-group" >
                                        <span class="input-group-addon" style="width: 30%">短信单价</span>
                                        <input class="form-control" name="save[dx_UnitPrice]" type="text" placeholder="短信单价" value="{$save[dx_UnitPrice]}">
                                        <span class="input-group-addon">元/条</span>
                                    </div>
                                </div>
                                <div class="col-sm-2"></div>
                            </div>
                        </div>
                    </div>
                    <div class="panel panel-default">
                        <div class="panel-heading">到期配置</div>
                        <div class="panel-body">
                            <div class="form-group">
                                <div class="col-sm-2"></div>
                                <div class="col-sm-1">到期后套餐</div>
                                <div class="col-sm-9">
                                    {loop $packages $item}
                                    <label class="radio-inline" style="padding-top:0px">
                                        <input type="radio" name="save[over_group]"  value="{$item[id]}" {if $item['id'] == $save['over_group']} checked {/if}> {$item["name"]}
                                    </label>
                                    {/loop}
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-sm-2"></div>
                                <div class="col-sm-8">
                                    <div class="input-group" >
                                        <span class="input-group-addon" style="width: 30%">到期提前</span>
                                        <input class="form-control" name="save[tx_date]" type="text" placeholder="提前几天提醒" value="{$save[tx_date]}">
                                        <span class="input-group-addon">天提醒</span>
                                    </div>
                                </div>
                                <div class="col-sm-2"></div>
                            </div>
                            <div class="form-group">
                                <div class="col-sm-2"></div>
                                <div class="col-sm-8">
                                    <textarea name="save[tx_email]" class="form-control richtext" rows="3">{$save[tx_email]}</textarea>
                                    <div class="help-block">提醒内容;<br/>变量名:<span style="color: red">#package#</span>  套餐名称 <span style="color: red">#day#</span> 时间<br/>例：您的#package#套餐将在#day#过期</div>
                                </div>
                                <div class="col-sm-2"></div>
                            </div>
                        </div>
                    </div>
                    <div class="panel panel-default">
                        <div class="panel-heading">套餐配置</div>
                        <div class="panel-body">
                            {loop $packages $item}
                            <div class="form-group">
                                <div class="col-sm-2"></div>
                                <div class="col-sm-8">
                                    <div class="input-group" >
                                        <span class="input-group-addon" style="width: 30%">{$item['name']}</span>
                                        <input class="form-control" name="packages[{$item[id]}][price]" type="text" placeholder="套餐价格" value="{$item['price']}">
                                        <span class="input-group-addon">元 <input type="checkbox" name="packages[{$item[id]}][hide]" value="1" {if $item['hide']==1}checked{/if}>对客户隐藏</span>
                                    </div>
                                </div>
                                <div class="col-sm-2"></div>
                            </div>
                            {/loop}
                            <div class="form-group">
                                <div class="col-sm-2"></div>
                                <div class="col-sm-8">
                                    <div class="input-group" >
                                        <span class="input-group-addon" style="width: 30%">套餐周期</span>
                                        <input class="form-control" name="save[package_day]" type="text" placeholder="周期" value="{$save['package_day']}">
                                        <span class="input-group-addon">天，<span style="color: red">未设置默认30天</span> </span>
                                    </div>
                                </div>
                            </div>
                            {loop $groups $item}
                            <div class="form-group">
                                <div class="col-sm-2"></div>
                                <div class="col-sm-8">
                                    <div class="input-group" >
                                        <span class="input-group-addon" style="width: 30%">{$item['name']}</span>
                                        <input class="form-control" name="groups[{$item[id]}][discount]" type="text" placeholder="用户组折扣" value="{$item['discount']}">
                                        <span class="input-group-addon">折，支持小数 比如：9.5 | 8 <span style="color: red">不打折请输 0</span> </span>
                                    </div>
                                </div>
                                <div class="col-sm-2"></div>
                            </div>
                            {/loop}
                        </div>
                    </div>
                    <div class="panel panel-default">
                        <div class="panel-heading">服务公告</div>
                        <div class="panel-body">
                            <div class="form-group">
                                <div class="col-sm-2"></div>
                                <div class="col-sm-8">
                                    <textarea name="save[service_gg]" class="form-control richtext" rows="3">{$save[service_gg]}</textarea>
                                </div>
                                <div class="col-sm-2"></div>
                            </div>
                        </div>
                    </div>
                    <div style="text-align: center;margin: 20px">
                        <input type="submit" class="btn btn-info" name="submit" value=" 保 存 "/>
                        <input type="hidden" name="token" value="{$_W['token']}" />
                    </div>
                </form>
            </section>
        </aside>
    </div>
</div>
<script language='javascript'>
    require(['jquery', 'util'], function($, u){
        $(function(){
            $.each($('.richtext'),function(i,o){
                u.editor($(o)[0]);
            });
        });
    });
</script>
{template 'common/footer'}